import { RouteConfig } from 'vue-router'
import AppLayout from '@/layout/index.vue'
import { MusicFolderSvg } from '@/assets/svg'

export const libraryRouter: RouteConfig = {
  name: 'Library',
  path: '/lib',
  component: AppLayout,
  redirect: { name: 'Index' },
  meta: {
    title: '乐库',
    icon: MusicFolderSvg,
    svg: true,
    menu: true
  },
  children: [
    /**
     * meta.icon for breadcrumb only supports Material Icon Font.
     */
    {
      name: 'LibraryIndex',
      path: 'index',
      component: () => import(/* webpackChunkName: "library" */ '@/views/index.vue')
    },
    {
      name: 'LibraryArtist',
      path: 'artists/:artistId',
      component: () => import(/* webpackChunkName: "library" */ '@/views/library/artist/index.vue'),
      meta: {
        title: '艺术家',
        icon: 'person'
      }
    },
    {
      name: 'LibraryAlbum',
      path: 'albums/:albumId',
      component: () => import(/* webpackChunkName: "library" */ '@/views/library/album/index.vue'),
      meta: {
        title: '专辑',
        icon: 'album'
      }
    },
    {
      name: 'LibrarySong',
      path: 'songs/:songId',
      component: () => import(/* webpackChunkName: "library" */ '@/views/library/song/index.vue'),
      meta: {
        title: '歌曲',
        icon: 'music_note'
      }
    }
  ]
}
